package com.wh.hotel.enums.base;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author wenhao
 */
@Getter
@AllArgsConstructor
public enum HotelOperateTypeEnum {


    ON(1, "上架操作"),
    OFF(2, "下架操作"),
    ;


    private final int code;
    private final String desc;

    public static HotelOperateTypeEnum parse(Integer code) {
        if (code == null) {
            return null;
        }
        for (HotelOperateTypeEnum statusEnum : HotelOperateTypeEnum.values()) {
            if (statusEnum.getCode() == code) {
                return statusEnum;
            }
        }
        return null;
    }
}
